<?php
include "common/cnfg.inc";

function main()
{/*{{{*/
    $svcenv=new svcenv();
    //$svcenv=new svcenv(cnfg::$svcenv['default']);
    $confirm=$svcenv->confirm();

    $arr=$confirm->generate();
    if($arr)
    {
        // arr['token']存入cookie
        setcookie("confirm_token", $arr['token'], 0, "/");
        // 显示图片
        header("Content-Type:image/png");
        echo base64_decode($arr['img']);
    }

    $svcenv->close();
}/*}}}*/

main();
?>
